/*
    Copyright 2011 - Tommi Laukkanen (www.substanceofcode.com)

    This file is part of NewsFlow.

    NewsFlow is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    NewsFlow is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with NewsFlow. If not, see <http://www.gnu.org/licenses/>.
*/

#include <QtGui/QApplication>
#include <QDeclarativeContext>
#include <QDeclarativeEngine>

#include <qdeclarative.h>
#include "qmlapplicationviewer.h"
#include "windowhelper.h"

int main(int argc, char *argv[])
{
#ifdef Q_OS_SYMBIAN
    QApplication::setGraphicsSystem(QLatin1String("openvg"));
#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
    QApplication::setGraphicsSystem(QLatin1String("opengl"));
#else
    QApplication::setGraphicsSystem(QLatin1String("raster"));
#endif

    QApplication app(argc, argv);
    app.setApplicationName("NewsFlow");
    app.setOrganizationDomain("substanceofcode.com");
    app.setApplicationVersion("1.3.1");

    QmlApplicationViewer viewer;

    WindowHelper *windowHelper = new WindowHelper(viewer);
    viewer.rootContext()->setContextProperty("windowHelper", windowHelper);

    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/NewsFlow/main.qml"));
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
    viewer.showFullScreen();
#else
    viewer.showFullScreen();
    //viewer.showMaximized();
#endif

    return app.exec();
}
